﻿<%
Class Model_Badword

	Public Table '数据表

	Private Sub Class_Initialize()
		Table = "badword"
	End Sub

	'默认缺省方法为Dao，注意：此方法必不可少！
	Public Default Function Dao()
		Set Dao = App.Dao.New
		Dao.Table = Table
	End Function

    Public Function name_exists(name, id)
		Dim bool : id = IntVal(id) : bool = False
		If Me.Dao.Where("badword='"& name &"'"& AB.C.IIF(id>0," AND id<>"& id,"")).Count() > 0 Then
			bool = True
		End If
		name_exists = bool
	End Function

End Class
%>